home *** CD-ROM | disk | FTP | other *** search
/ SPACE 2 / SPACE - Library 2 - Volume 1.iso / program / 317 / asmsrc / gnu-out.h < prev    next >
Encoding:
C/C++ Source or Header  |  1988-10-20  |  2.6 KB  |  83 lines

  1. /* Copyright (C) 1987 Free Software Foundation, Inc.
  2.  
  3. This file is part of Gas, the GNU Assembler.
  4.  
  5. The GNU assembler is distributed in the hope that it will be
  6. useful, but WITHOUT ANY WARRANTY.  No author or distributor
  7. accepts responsibility to anyone for the consequences of using it
  8. or for whether it serves any particular purpose or works at all,
  9. unless he says so in writing.  Refer to the GNU Assembler General
  10. Public License for full details.
  11.  
  12. Everyone is granted permission to copy, modify and redistribute
  13. the GNU Assembler, but only under the conditions described in the
  14. GNU Assembler General Public License.  A copy of this license is
  15. supposed to have been given to you along with the GNU Assembler
  16. so you can know your rights and responsibilities.  It should be
  17. in a file named COPYING.  Among other things, the copyright
  18. notice and this notice must be preserved on all copies.  */
  19.  
  20. /* JF I'm not sure where this file came from.  I put the permit.text message in
  21.    it anyway.  This file came to me as part of the original VAX assembler */
  22.  
  23. #define OMAGIC 0407
  24. #define NMAGIC 0410
  25. #define ZMAGIC 0413
  26.  
  27. struct exec {
  28.     long    a_magic;            /* number identifies as .o file and gives type of such. */
  29.     unsigned a_text;        /* length of text, in bytes */
  30.     unsigned a_data;        /* length of data, in bytes */
  31.     unsigned a_bss;        /* length of uninitialized data area for file, in bytes */
  32.     unsigned a_syms;        /* length of symbol table data in file, in bytes */
  33.     unsigned a_entry;        /* start address */
  34.     unsigned a_trsize;        /* length of relocation info for text, in bytes */
  35.     unsigned a_drsize;        /* length of relocation info for data, in bytes */
  36. };
  37.  
  38. #define N_BADMAG(x) \
  39.  (((x).a_magic)!=OMAGIC && ((x).a_magic)!=NMAGIC && ((x).a_magic)!=ZMAGIC)
  40.  
  41. #define N_TXTOFF(x) \
  42.  ((x).a_magic == ZMAGIC ? 1024 : sizeof(struct exec))
  43.  
  44. #define N_SYMOFF(x) \
  45.  (N_TXTOFF(x) + (x).a_text + (x).a_data + (x).a_trsize + (x).a_drsize)
  46.  
  47. #define N_STROFF(x) \
  48.  (N_SYMOFF(x) + (x).a_syms)
  49.  
  50. struct nlist {
  51.     union {
  52.         char    *n_name;
  53.         struct nlist *n_next;
  54.         long    n_strx;
  55.     } n_un;
  56.     char    n_type;
  57.     char    n_other;
  58.     short    n_desc;
  59.     unsigned n_value;
  60. };
  61.  
  62. #define N_UNDF    0
  63. #define N_ABS    2
  64. #define N_TEXT    4
  65. #define N_DATA    6
  66. #define N_BSS    8
  67. #define N_FN    31        /* JF: Someone claims this should be 31 instead of
  68.                15.  I just inherited this file; I didn't write
  69.                it.  Who is right? */
  70.  
  71. #define N_EXT 1
  72. #define N_TYPE 036
  73. #define N_STAB 0340
  74.  
  75. struct relocation_info {
  76.     int    r_address;
  77.     unsigned r_symbolnum:24,
  78.         r_pcrel:1,
  79.         r_length:2,
  80.         r_extern:1,
  81.         nuthin:4;
  82. };
  83.